

import { Request } from "@/until/request.js"



//首页接口
export const HomeRight = Request.getData({
    url : `/api/statistic/base_count.do`,
    method : "get",
    // data
})
//登录接口
export const login = (obj,data) => Request.getData({
    url : `/api/user/login.do?username=${obj.username}&password=${obj.password}`,
    method : "post",
    // data
})




//商品管理列表
export const goodsList = data => Request.getData({
    url :`/api/product/list.do`,
    method:"get",
    data
})
//商品管理列表分页
export const goodsPage =(obj,data) => Request.getData({
    url :`/api/product/list.do?pageNum=${obj}`,
    method:"get",
    data
})
//商品管理列表搜索
export const shopListSearch = data => Request.getData({
    url:"/api/product/search.do",
    method:"get",
    data,
})
// 商品管理搜索后分页
export const shopSearchPagination = data => Request.getData({
    url:"/api/product/search.do",
    method:"get",
    data,
})
//商品管理上架  下架
export const shopSale = data => Request.getData({
    url:"/api/product/set_sale_status.do",
    method:"get",
    data,
})

//商品管理     添加商品     一级分类菜单
export const additive = data => Request.getData({
    url:"/api/category/get_category.do?categoryId=0",
    method:"get",
    data,
})
//商品管理     添加商品     二级分类菜单
export const additive2 = (obj,data) => Request.getData({
// /category/get_category.do?categoryId=100056
    url:`/api/category/get_category.do?categoryId=${obj}`,
    method:"get",
    data,
})
//商品管理     添加商品     提交
export const cook = (obj,data) => Request.getData({
    url:`/api/product/save.do?categoryId=${obj.categoryId}&name=${obj.name}&subtitle=${obj.subtitle}&mainImage=${obj.mainImage}&detail=${obj.detail}&price=${obj.price}&stock=${obj.stock}&status=${obj.status}`,
    method:"get",
    data,
})

//查看
//      /api/product/detail.do?productId=26
export const check = (obj,data) => Request.getData({
    url:`/api/product/detail.do?productId=${obj}`,
    method:"get",
    data,
})
//商品管理     添加商品     修改
export const amend = (obj,data) => Request.getData({
    url:`/api/product/save.do?categoryId=${obj.categoryId}&name=${obj.name}&subtitle=${obj.subtitle}&subImages=${obj.subImages}&detail=${obj.detail}&price=${obj.price}&stock=${obj.stock}&status=${obj.status}&id=${obj.id}`,
    method:"get",
    data,
})





//品类管理列表
export const Category = (obj,data) => Request.getData({
    url : `/api/category/get_category.do?categoryId=0`,
    method : "get",
})
//品类管理查看
export const chalei = (obj,data) => Request.getData({
    url : `/api/category/get_category.do?categoryId=${obj}`,
    method : "get",
})
// 修改名称
export const name = (obj,data) => Request.getData({
    url :`/api/category/set_category_name.do?categoryId=${obj.categoryId}&categoryName=${obj.categoryName}`,
    method:"get",
    data
})
// 添加品类
export const category = (obj,data) => Request.getData({
    url :`/api/category/get_category.do?categoryId=0`,
    method:"get",
    data
})
// 添加品类     提交品类
export const categoryadd = (obj,data) => Request.getData({
    url :`/api/category/add_category.do?parentId=0&categoryName=${obj}`,
    method:"get",
    data
})
//  http://adminv2.happymmall.com/manage/category/get_category.do?categoryId=100005
export const ViewSubcategories = (obj,data) => Request.getData({
    url :`/api/category/get_category.do?categoryId=${obj}`,
    method:"get",
    data
})


//订单管理列表
export const Order = (obj,data) => Request.getData({
    url : `/api/order/list.do?pageNum=${obj}`,
    method : "get",
})
//订单分页
export const orderPage = (obj,data) => Request.getData({
    url : `/api/order/list.do?pageNum=${obj}`,
    method : "get",
})
// 查看订单
export const detail = (obj,data) => Request.getData({
    url :`/api/order/detail.do?orderNo=${obj}`,
    method:"get",
    data
})
// 查询接口
export const search = (obj,data) => Request.getData({
    url :`/api/order/search.do?listType=search&pageNum=${obj.pageNum}&orderNo=${obj.orderNo}`,
    method:"get",
    data
})






//用户列表
export const UserList = (obj,data) => Request.getData({
    url : `/api/user/list.do`,
    method : "post",
})


//用户列表分页器
export const List = data => Request.getData({
    url : `/api/user/list.do?pageNum=${data}`,
    method : "post",
})
